package de.slothsoft.commons;

import java.util.Comparator;

public class DisplayableComparator implements Comparator<IDisplayable> {

	@Override
	public int compare(IDisplayable o1, IDisplayable o2) {
		if (o1 == o2)
			return 0;
		if (o1 == null)
			return -1;
		if (o2 == null)
			return 1;
		return o1.getDisplayName().compareTo(o2.getDisplayName());
	}

}
